home *** CD-ROM | disk | FTP | other *** search
/ Aminet 49 / Aminet 49 (2002)(GTI - Schatztruhe)[!][Jun 2002].iso / Aminet / util / libs / muitoolkit-2.1.lha / muitoolkit-2.1 / developer / autodocs / MuiToolkit.doc
Encoding:
Text File  |  1999-11-28  |  32.4 KB  |  1,199 lines

  1. TABLE OF CONTENTS
  2.  
  3. MuiToolkit/-Preface-
  4. MuiToolkit/mt_Get
  5. MuiToolkit/mt_ParseHotkey
  6. MuiToolkit/mt_Label
  7. MuiToolkit/mt_PopButton
  8. MuiToolkit/mt_Checkmark
  9. MuiToolkit/mt_Cycle
  10. MuiToolkit/mt_CycleWeight
  11. MuiToolkit/mt_Slider
  12. MuiToolkit/mt_SliderFmt
  13. MuiToolkit/mt_String
  14. MuiToolkit/mt_StringSecret
  15. MuiToolkit/mt_StringAccept
  16. MuiToolkit/mt_StringReject
  17. MuiToolkit/mt_Button
  18. MuiToolkit/mt_ButtonWeight
  19. MuiToolkit/mt_ButtonToggle
  20. MuiToolkit/mt_WinOpen
  21. MuiToolkit/mt_WinClose
  22. MuiToolkit/mt_WinAttach
  23. MuiToolkit/mt_WinDetach
  24. MuiToolkit/mt_Text
  25. MuiToolkit/mt_GetStringA
  26. MuiToolkit/mt_GetIntegerA
  27. MuiToolkit/mt_Radio
  28. MuiToolkit/mt_Check
  29.  
  30. MuiToolkit/-Preface-
  31.  
  32. Anyone being the author of more than one MUI based application most
  33. probably realized, that using some predefined MUI macros
  34. (<libraries/mui.h>) speeds up 'writting' the GUI, but most of the authors
  35. sooner of later write their own bunch of functions and uses them for
  36. creation of the gui instead of standard one.  And so did I, creating my own
  37. pool of routines I use in my apps to approach "TLBRTS" (Type Less But Reach
  38. The Same{tm} ;-) goal.
  39.  
  40.  
  41. 1. Why ppl creates own functions while, as I said, mui.h defines
  42.    some useful you said macros?
  43.  
  44. IMHO mostly because these macros are useful but very limited.  To make your
  45. GUI nice and useable you still have to set other tags by hand.  For
  46. instance Cycle() macro most of ppl use to create Cycle objects does not put
  47. your object in cycle chain (so your user can't activate your object while
  48. browsing thru the object chain with TAB).  It also does not help you making
  49. your cycle object hotkey driven.  And what I find most lame, especially
  50. in context of MUI based applications, is lack of keyboard control.  That
  51. the user's point of view.  As programmer, I don't like typing too much,
  52. especially I know it can look simplier.
  53.  
  54.  
  55. 2. Any clue then?
  56.  
  57. I just moved all my own MUI related helper-functions into the shared
  58. library (named muitoolkit as you probably guessed).  It features all
  59. helper-functions *I* use in my apps to create user interface.  For example,
  60. to create basic but 'comfortable' string object, with bubble help, hotkey
  61. and being cycle chaied, instead of typing:
  62.  
  63. obj = StringObject,
  64.               MUIA_Frame, MUIV_Frame_String,
  65.               MUIA_ControlChar, 't',
  66.               MUIA_String_MaxLen, maxlen,
  67.               MUIA_CycleChain, TRUE,
  68.               MUIA_String_AdvanceOnCR, TRUE,
  69.               MUIA_String_Contents, "str",
  70.               MUIA_String_MaxLen, 30,
  71.               MUIA_ShortHelp, "I hate typing",
  72.               End;
  73.  
  74. I just type:
  75.  
  76. obj = mt_String("hi", 30, "_Type something", "I love that");
  77.  
  78. and voila. Nice? Hope so ;-)
  79.  
  80. Note:  the hotkey in the above example is automatically extracted out of
  81. the "_Type something" label string.  It may look stupid at the 1st sight,
  82. but if you realize, the most hotkey driven objects are paired with labels,
  83. then you probably find out that the string "_Type something" is in fact the
  84. label string.  So you pass the same string to mt_Label() call while
  85. creating the label, and to related mt_String() (or any other MT object) and
  86. you are done with hotkey driven object.  It became even more 'natural' when
  87. you use localization (and you should)), so your translators have easier
  88. job.
  89.  
  90. Among the object creation functions, MuiToolkit also features string,
  91. numeric string requester (something like ReqTools offers for instance) etc.
  92. And I plan more of course. For now, don't forget to watch enclosed
  93. demo program!
  94.  
  95.  
  96. 3. Who would benefit from using such library?
  97.  
  98. I think we all could.  Programmers (some of us), because they can type less
  99. and still got good and user friendly interfaces.  The app will reduce in
  100. size (well, recently not much about 10K, but it's v1.0, but later, who
  101. knows ;).  The users (we all), because the GUI of MUI programs may start to
  102. be less 'primitive' and more "friendly".  I hope "user friendly" would stop
  103. mean that "the user have to be friendly", which is unfortunately ofter for
  104. not, only begginers' app.
  105.  
  106.  
  107. 4. Fees?
  108.  
  109. MuiToolkit is and will remain freeware.  The source is available so anyone
  110. is now be able to contribute (welcome, welcome!) or to bug fix as well.
  111.  
  112.  
  113. 5. Author
  114.  
  115.    Marcin Orlowski
  116.    P.O. Box 91
  117.    71-507 Szczecin 5
  118.    Poland
  119.  
  120.    e-mail: carlos@amiga.com.pl
  121.    WWW:    http://wfmh.org.pl/~carlos/
  122.  
  123.    MuiToolkit and other MUI stuff:
  124.    WWW:    http://amiga.com.pl/mcc/
  125.    FTP:    ftp://amiga.com.pl/pub/mcc/
  126.  
  127.  
  128.    $Id: muitoolkit.doc,v 1.2 1999/09/01 21:28:43 carlos Exp $
  129.  
  130. MuiToolkit/mt_Get
  131.  
  132.     NAME
  133.     mt_Get - easier getting object arguments
  134.  
  135.     SYNOPSIS
  136.     mt_Get( object, attribute );
  137.             A0      D0
  138.  
  139.     ULONG mt_Get( Object *object, ULONG attribute );
  140.  
  141.     FUNCTION
  142.     Just easier to use get() macro replacement. Instead
  143.     of giving the pointer to ULONG for the result value
  144.     (that's the often begginers' bug), you get it returned
  145.     as from other functions.
  146.  
  147.     INPUTS
  148.     object      - the pointer to Object to query
  149.     attribute   - the attribute you want to know the value of
  150.  
  151.     RESULT
  152.     Attribute value (type depends on object GET method handling,
  153.     but it's always 32 bit value) or NULL.
  154.  
  155.     EXAMPLE
  156.     printf("Volume is %ld dB\n", mt_Get(obj, MUIA_Slider_Level));
  157.  
  158.     SEE ALSO
  159.  
  160.     BUGS
  161.  
  162. MuiToolkit/mt_ParseHotkey
  163.  
  164.     NAME
  165.     mt_ParseHotkey - parses given string and returns hot key (if any)
  166.  
  167.     SYNOPSIS
  168.     mt_ParseHotkey( string );
  169.                     A0
  170.  
  171.     char mt_ParseHotkey( char *string );
  172.  
  173.     FUNCTION
  174.     However MT powered GUI objects automatically use hotkeys whenever
  175.     available, if it may would be useful (for some purposes) to you to
  176.     find out if in the given string any hotkey is defined, call this
  177.     function. By hotkey, I mean the character (letter, numer etc) that
  178.     should be used e.g. for keyboard object control. Since gadtools
  179.     the standard of defining the hotkey is to prefix the character
  180.     with the underscore ('_'). 
  181.  
  182.     INPUTS
  183.     string      - the string to parse
  184.  
  185.     RESULT
  186.     The first found hotkey character or NULL if there's no such present.
  187.  
  188.     EXAMPLE
  189.     mt_ParseHotkey("What's _the hotkey?");
  190.  
  191.     would return 't'.
  192.     
  193.     SEE ALSO
  194.  
  195.     BUGS
  196.  
  197. MuiToolkit/mt_Label
  198.  
  199.     NAME
  200.     mt_Label - creates label object
  201.  
  202.     SYNOPSIS
  203.     mt_Label( string );
  204.               A0
  205.  
  206.     Object * mt_Label( char *string );
  207.  
  208.     FUNCTION
  209.     Creates so called label. You usually use labels to describe the
  210.     meaning of the gadget (e.g. "Your name" before string gadget is
  211.     the good label example). This function creates such object for
  212.     you, taking care of the proper hotkey handling (if label uses
  213.     such) etc.
  214.  
  215.     INPUTS
  216.     string      - the label text itself
  217.  
  218.     RESULT
  219.     Pointer to created object, or NULL if failed
  220.  
  221.     EXAMPLE
  222.     mt_Label("_Server name:");
  223.  
  224.     SEE ALSO
  225.  
  226.     BUGS
  227.  
  228. MuiToolkit/mt_PopButton
  229.  
  230.     NAME
  231.     mt_PopButton - creates image pop button object
  232.  
  233.     SYNOPSIS
  234.     mt_PopButton( imgage, label )
  235.                   D0      A0
  236.  
  237.     Object * mt_PopButton( int image, char *label );
  238.  
  239.     FUNCTION
  240.     The goal of using this call instead of built-in MUI macro is,
  241.     that your popup button will be automatically cyclechained
  242.     (but that obvious for MT ;-) and you can easily hotkey it.
  243.  
  244.     INPUTS
  245.     image       - the image type (see MUII_#? values)
  246.     label       - the label string, MT will try to extract the
  247.                   hotkey from, or NULL if you either don't have
  248.                   any, or don't want the button to be hotkeyed
  249.  
  250.     RESULT
  251.     Pointer to created object, or NULL if failed
  252.  
  253.     EXAMPLE
  254.     mt_PopButton( MUII_PopUp, GetString( MSG_BAUD_LABEL ) );
  255.  
  256.     SEE ALSO
  257.     libraries/mui.h for MUII_#?
  258.  
  259.     BUGS
  260.  
  261. MuiToolkit/mt_Checkmark
  262.  
  263.     NAME
  264.     mt_Checkmark    - creates checkmark object
  265.  
  266.     SYNOPSIS
  267.     mt_Checkmark( label, value, help )
  268.                   A0     D0     A1
  269.  
  270.     Object * mt_Checkmark( char *label, BOOL value, char *help );
  271.  
  272.     FUNCTION
  273.     The simple way of creating nice checkmark object with one call.
  274.  
  275.     INPUTS
  276.     label       - the label string, MT will try to extract the
  277.                   hotkey from, or NULL if you either don't have
  278.                   any, or don't want the object to be hotkeyed
  279.     value       - startup value of the object (TRUE/FALSE)
  280.     help        - optional pointer to the bubble help text,
  281.                   or NULL if you don't have any
  282.  
  283.     RESULT
  284.     Pointer to created object, or NULL if failed
  285.  
  286.     EXAMPLE
  287.     mt_Checkmark( GetString( LABEL ), FALSE, "Select if you\nwant to ;-)");
  288.  
  289.     SEE ALSO
  290.  
  291.     BUGS
  292.  
  293. MuiToolkit/mt_Cycle
  294.  
  295.     NAME
  296.     mt_Cycle    - creates nice cycle object
  297.  
  298.     SYNOPSIS
  299.     mt_Cycle( array, label, value, help )
  300.               A0     A1     d0     A2
  301.  
  302.     Object * mt_Cycle( char *array, char *label, 
  303.                        ULONG value, char *help );
  304.  
  305.     FUNCTION
  306.     The simple way of creating nice cycle object with one call.
  307.  
  308.     INPUTS
  309.     array       -  Here you can define what entries
  310.                    shall be displayed in your cycle gadget.
  311.                    You must supply a pointer to a string array,
  312.                    containing one entry for each item and
  313.                    terminated with a NULL.
  314.  
  315.                    Remember that cycle gadget entries may
  316.                    contain any text formatting code such
  317.                    as bold, italic or underlined characters.
  318.  
  319.                    Cycle gadgets set the preparse string
  320.                    for all entries to "\33c", this means
  321.                    that they will automatically appear
  322.                    centered. Of course you can override this
  323.                    by simply preceding your entries with own
  324.                    formatting code.
  325.     label       - the label string, MT will try to extract the
  326.                   hotkey from, or NULL if you either don't have
  327.                   any, or don't want the object to be hotkeyed
  328.     value       - startup value of the object
  329.     help        - optional pointer to the bubble help text,
  330.                   or NULL if you don't have any
  331.  
  332.     RESULT
  333.     Pointer to created object, or NULL if failed
  334.  
  335.     EXAMPLE
  336.     static const char *CycleArray[] =
  337.     {
  338.        "normal",
  339.        "highlight",
  340.        "3-dimensional",
  341.        NULL
  342.     };
  343.  
  344.     mt_Cycle( CycleArray, "_Preview", 2, NULL);
  345.  
  346.     SEE ALSO
  347.     Cycle object autodocs
  348.  
  349.     BUGS
  350.  
  351. MuiToolkit/mt_CycleWeight
  352.  
  353.     NAME
  354.     mt_Cycle    - creates nice cycle object with given weight
  355.  
  356.     SYNOPSIS
  357.     mt_Cycle( array, label, value, weight, help )
  358.               A0     A1     d0     D1      A2
  359.  
  360.     Object * mt_Cycle( char *array, char *label, ULONG value,
  361.                        long weight, char *help );
  362.  
  363.     FUNCTION
  364.     The same as mt_Cycle, but you can determine the weight of
  365.     the newly created object.
  366.  
  367.     INPUTS
  368.     array       - Cycle entries
  369.     label       - the label string, MT will try to extract the
  370.                   hotkey from, or NULL if you either don't have
  371.                   any, or don't want the object to be hotkeyed
  372.     value       - startup value of the object
  373.     weight      - weight of the object
  374.     help        - optional pointer to the bubble help text,
  375.                   or NULL if you don't have any
  376.  
  377.     RESULT
  378.     Pointer to created object, or NULL if failed
  379.  
  380.     EXAMPLE
  381.     static const char *CycleArray[] =
  382.     {
  383.        "normal",
  384.        "highlight",
  385.        "3-dimensional",
  386.        NULL
  387.     };
  388.  
  389.     mt_CycleWeight( CycleArray, "_Preview", 2, 50, NULL);
  390.  
  391.     SEE ALSO
  392.     mt_Cycle, Cycle object autodocs, Area/MUIA_Weight
  393.  
  394.     BUGS
  395.  
  396. MuiToolkit/mt_Slider
  397.  
  398.     NAME
  399.     mt_Slider   - creates slider object with one call
  400.  
  401.     SYNOPSIS
  402.     mt_Slider( min, max, level, label, help )
  403.                D0   D1   D2     A0     A1
  404.  
  405.     Object * mt_Slider( int min, int max, int level,
  406.                            char *str, char *help );
  407.  
  408.     FUNCTION
  409.     Creates slider object
  410.  
  411.     INPUTS
  412.     min         - the minimal value
  413.     max         - the maxum
  414.     level       - default level of the knob
  415.     label       - the label string, MT will try to extract the
  416.                   hotkey from, or NULL if you either don't have
  417.                   any, or don't want the object to be hotkeyed
  418.     help        - optional pointer to the bubble help text,
  419.                   or NULL if you don't have any
  420.  
  421.     RESULT
  422.     Pointer to created object, or NULL if failed
  423.  
  424.     EXAMPLE
  425.  
  426.     SEE ALSO
  427.     mt_Slider
  428.  
  429.     BUGS
  430.  
  431. MuiToolkit/mt_SliderFmt
  432.  
  433.     NAME
  434.     mt_SliderFmt   - creates slider object with custom
  435.                      format text
  436.  
  437.     SYNOPSIS
  438.     mt_SliderFmt( min, max, level, label, fmt, help )
  439.                   D0   D1   D2     A0     A1   A2
  440.  
  441.     Object * mt_SliderFmt( int min, int max, int level,
  442.                 char *label, char *fmt, char *help )
  443.  
  444.  
  445.     FUNCTION
  446.     Creates slider object with defined format text
  447.  
  448.     INPUTS
  449.     min         - the minimal value
  450.     max         - the maxum
  451.     level       - default level of the knob
  452.     label       - the label string, MT will try to extract the
  453.                   hotkey from, or NULL if you either don't have
  454.                   any, or don't want the object to be hotkeyed
  455.     fmt         - the format string, where "%ld" instance will
  456.                   be replaced by the current knob value
  457.     help        - optional pointer to the bubble help text,
  458.                   or NULL if you don't have any
  459.  
  460.     RESULT
  461.     Pointer to created object, or NULL if failed
  462.  
  463.     EXAMPLE
  464.     mt_SliderFmt( 10,30,20, "_Delay", "%ld sec.", "Delay in seconds");
  465.  
  466.     SEE ALSO
  467.     mt_Slider, MUIA_Slider_Format
  468.  
  469.     BUGS
  470.  
  471. MuiToolkit/mt_String
  472.  
  473.     NAME
  474.     mt_String       - creates string object
  475.  
  476.     SYNOPSIS
  477.     mt_String( string, maxlen, label, help )
  478.                A0      D0      A1     A2
  479.  
  480.  
  481.     Object * mt_String( char *string, int maxlen,
  482.                           char *label, char *help );
  483.  
  484.     FUNCTION
  485.     Creates string object. Recently MT uses built-in string
  486.     object class to construct the gadget, but future versions may
  487.     automatically (and transparently to your application) benefit
  488.     from all these string gadget replacements like Textinput or
  489.     Betterstring classes
  490.  
  491.     INPUTS
  492.     string      - default string contents (or NULL or "" if none)
  493.     maxlen      - the max len of the string allowed to be entered
  494.                   (including terminating NULL byte)
  495.     label       - the label string, MT will try to extract the
  496.                   hotkey from, or NULL if you either don't have
  497.                   any, or don't want the object to be hotkeyed
  498.     help        - optional pointer to the bubble help text,
  499.                   or NULL if you don't have any
  500.  
  501.     RESULT
  502.     Pointer to created object, or NULL if failed
  503.  
  504.     EXAMPLE
  505.     mt_String( "NoName", 30, "_Project", NULL);
  506.  
  507.     SEE ALSO
  508.     String class autodocs
  509.  
  510.     BUGS
  511.  
  512. MuiToolkit/mt_StringSecret
  513.  
  514.     NAME
  515.     mt_StringSecret     - creates secret string object
  516.  
  517.     SYNOPSIS
  518.     mt_StringSecret( string, maxlen, label, help )
  519.                      A0      D0      A1     A2
  520.  
  521.  
  522.     Object * mt_StringSecret( char *string, int maxlen,
  523.                               char *label, char *help );
  524.  
  525.  
  526.     FUNCTION
  527.     Same as mt_String, but the object will be echoing "*" instead
  528.     of entered characters (good for passwords etc).
  529.  
  530.     INPUTS
  531.     string      - default string contents (or NULL or "" if none)
  532.     maxlen      - the max len of the string allowed to be entered
  533.                   (including terminating NULL byte)
  534.     label       - the label string, MT will try to extract the
  535.                   hotkey from, or NULL if you either don't have
  536.                   any, or don't want the object to be hotkeyed
  537.     help        - optional pointer to the bubble help text,
  538.                   or NULL if you don't have any
  539.  
  540.     RESULT
  541.     Pointer to created object, or NULL if failed
  542.  
  543.     EXAMPLE
  544.     mt_StringSecret( NULL, 30, "_Passwd", NULL);
  545.  
  546.     SEE ALSO
  547.     String class autodocs, MUIA_String_Secret
  548.  
  549.     BUGS
  550.  
  551. MuiToolkit/mt_StringAccept
  552.  
  553.     NAME
  554.     mt_StringAccept     - creates string object with given
  555.                           pool of character pool object accepts
  556.                           for input
  557.  
  558.     SYNOPSIS
  559.     mt_StringAccept( string, maxlen, label, accept, help )
  560.                      A0      D0      A1     A2      A3
  561.  
  562.  
  563.     Object * mt_StringAccept( char *string, int maxlen,
  564.                               char *label, char *accept,
  565.                               char *help );
  566.  
  567.  
  568.     FUNCTION
  569.     Same as mt_String, but you can specify what characters user
  570.     may enter. Useful for e.g. IRC nick etc.
  571.  
  572.     INPUTS
  573.     string      - default string contents (or NULL or "" if none)
  574.     maxlen      - the max len of the string allowed to be entered
  575.                   (including terminating NULL byte)
  576.     accept      - the string with the allowed charasters
  577.     label       - the label string, MT will try to extract the
  578.                   hotkey from, or NULL if you either don't have
  579.                   any, or don't want the object to be hotkeyed
  580.     help        - optional pointer to the bubble help text,
  581.                   or NULL if you don't have any
  582.  
  583.     RESULT
  584.     Pointer to created object, or NULL if failed
  585.  
  586.     EXAMPLE
  587.     mt_StringAccept( NULL, 30, "abcdef", "_Passwd", "Try any digit");
  588.  
  589.     SEE ALSO
  590.     String class autodocs, MUIA_String_Accept
  591.  
  592.     BUGS
  593.  
  594. MuiToolkit/mt_StringReject
  595.  
  596.     NAME
  597.     mt_StringReject     - creates string object with given
  598.                           pool of not allowed characters
  599.  
  600.     SYNOPSIS
  601.     mt_StringReject( string, maxlen, label, reject, help )
  602.                      A0      D0      A1     A2      A3
  603.  
  604.  
  605.     Object * mt_StringReject( char *string, int maxlen,
  606.                               char *label, char *reject,
  607.                               char *help );
  608.  
  609.  
  610.     FUNCTION
  611.     Same as mt_String, but you can specify what characters user
  612.     may enter. Useful for e.g. IRC nick etc.
  613.  
  614.     INPUTS
  615.     string      - default string contents (or NULL or "" if none)
  616.     maxlen      - the max len of the string allowed to be entered
  617.                   (including terminating NULL byte)
  618.     reject      - the string with charasters to reject on input
  619.     label       - the label string, MT will try to extract the
  620.                   hotkey from, or NULL if you either don't have
  621.                   any, or don't want the object to be hotkeyed
  622.     help        - optional pointer to the bubble help text,
  623.                   or NULL if you don't have any
  624.  
  625.     RESULT
  626.     Pointer to created object, or NULL if failed
  627.  
  628.     EXAMPLE
  629.     mt_StringReject( NULL, 30, "0123456789", "_Passwd", "Try any digit");
  630.  
  631.     SEE ALSO
  632.     String class autodocs, MUIA_String_Reject
  633.  
  634.     BUGS
  635.  
  636. MuiToolkit/mt_Button
  637.  
  638.     NAME
  639.     mt_Button            - creates simple button object
  640.  
  641.     SYNOPSIS
  642.     mt_Button( label, help )
  643.                A0     A1
  644.  
  645.  
  646.  
  647.     Object * mt_Button( char *label, char *help );
  648.  
  649.  
  650.     FUNCTION
  651.     Creates ordinary text button object.
  652.  
  653.  
  654.     INPUTS
  655.     label       - the button text. MT will try to extract the
  656.                   hotkey from this string and use it if present
  657.     help        - optional pointer to the bubble help text,
  658.                   or NULL if you don't have any
  659.  
  660.     RESULT
  661.     Pointer to created object, or NULL if failed
  662.  
  663.     EXAMPLE
  664.     mt_Button( "_Save", "Saves the Queen" );
  665.  
  666.     SEE ALSO
  667.  
  668.     BUGS
  669.  
  670. MuiToolkit/mt_ButtonWeight
  671.  
  672.     NAME
  673.     mt_ButtonWeight     - creates simple button object with given
  674.                           object weight
  675.  
  676.     SYNOPSIS
  677.     mt_ButtonWeight( label, weight, help )
  678.                      A0     D0      A1
  679.  
  680.  
  681.  
  682.     Object * mt_ButtonWeight( char *label, int weight, char *help );
  683.  
  684.  
  685.     FUNCTION
  686.     Creates ordinary text button object (same as mt_Button), but
  687.     sets object weight to the given value
  688.  
  689.  
  690.     INPUTS
  691.     label       - the button text. MT will try to extract the
  692.                   hotkey from this string and use it if present
  693.     weight      - object weight
  694.     help        - optional pointer to the bubble help text,
  695.                   or NULL if you don't have any
  696.  
  697.     RESULT
  698.     Pointer to created object, or NULL if failed
  699.  
  700.     EXAMPLE
  701.     mt_ButtonWeight( "_Save", 10, "Saves the Queen" );
  702.  
  703.     SEE ALSO
  704.     MUIA_Weight
  705.  
  706.     BUGS
  707.  
  708. MuiToolkit/mt_ButtonToggle
  709.  
  710.     NAME
  711.     mt_ButtonToggle   - creates simple toggle button object
  712.  
  713.     SYNOPSIS
  714.     mt_ButtonToggle( label, help )
  715.                A0     A1
  716.  
  717.  
  718.  
  719.     Object * mt_ButtonToggle( char *label, char *help );
  720.  
  721.  
  722.     FUNCTION
  723.     Creates ordinary text button object with toggle input mode.
  724.     Useful for button based checkmark alikes.
  725.  
  726.  
  727.     INPUTS
  728.     label       - the button text. MT will try to extract the
  729.                   hotkey from this string and use it if present
  730.     help        - optional pointer to the bubble help text,
  731.                   or NULL if you don't have any
  732.  
  733.     RESULT
  734.     Pointer to created object, or NULL if failed
  735.  
  736.     EXAMPLE
  737.     mt_ButtonToggle( "AutoSave", "If active, would Save The Queen every 10 minutes" );
  738.  
  739.     SEE ALSO
  740.     MUIA_InputMode
  741.  
  742.     BUGS
  743.  
  744. MuiToolkit/mt_WinOpen
  745.  
  746.     NAME
  747.     mt_WinOpen   - opens the given window object with the check
  748.  
  749.     SYNOPSIS
  750.     mt_WinOpen( window )
  751.                 A0
  752.  
  753.  
  754.     ULONG mt_WinOpen( Object *window );
  755.  
  756.  
  757.     FUNCTION
  758.     Opens given window object, and checks if window was succesfuly opened.
  759.     The one of major bugs in (even serious MUI apps) is the assumption that
  760.     everything will work fine. So programmers sets the MUIA_Window_Open
  761.     to TRUE and don't bother checking if the window is opened! And there're
  762.     many many situations that may cause the open window to fail. And then
  763.     user is stucked, because e.g. to continue, s/he needs to press "Proceed"
  764.     in unopened window.
  765.  
  766.     INPUTS
  767.     window      - the window object to open
  768.  
  769.     RESULT
  770.     FALSE if window open failed, otherwise TRUE
  771.  
  772.     EXAMPLE
  773.     if( mt_WinOpen( MyWindow ) )
  774.         {
  775.         //... ok, it worked ;-)
  776.         }
  777.     else
  778.         {
  779.         printf( "Can't open window!\n" );
  780.         }
  781.  
  782.     SEE ALSO
  783.     mt_WinClose, MUIA_Window_Open
  784.  
  785.     BUGS
  786.  
  787. MuiToolkit/mt_WinClose                                 * THIS IS A MACRO *
  788.  
  789.     NAME
  790.     mt_WinClose   - closes the given window object
  791.  
  792.     SYNOPSIS
  793.  
  794.     void mt_WinOpen( Object *window );
  795.  
  796.  
  797.     FUNCTION
  798.     Closes given window object.  This is a *MACRO* (see includes), not a
  799.     real library function. It was defined just to pair mt_WinOpen.
  800.  
  801.     INPUTS
  802.     window      - the window object to close
  803.  
  804.     RESULT
  805.  
  806.  
  807.     EXAMPLE
  808.     mt_WinClose( MyWindow );
  809.  
  810.  
  811.     SEE ALSO
  812.     mt_WinOpen, libraries/muitoolkit.h
  813.  
  814.  
  815.     BUGS
  816.  
  817. MuiToolkit/mt_WinAttach
  818.  
  819.     NAME
  820.     mt_WinAttach      - attach the given window object to the application
  821.  
  822.     SYNOPSIS
  823.     mt_WinAttach( app, window )
  824.                   A0   A1
  825.  
  826.  
  827.     ULONG mt_WinAttach( Object *app, Object *window );
  828.  
  829.  
  830.     FUNCTION
  831.     This is a support call for the programmers writting their applications
  832.     in the Right Way{tm}, with the dynamically created objects. Imagine
  833.     your program offers 20 various windows for various purposes. Creating
  834.     all of them at the program start is just a waste of time and resources.
  835.     The Right Way{tm} is to create them only when necessary (e.g. user is
  836.     going to use it), attach the created window object to application,
  837.     and then destroy when user finished (note: sometimes may be better to
  838.     keep created windows. That prevents the gadgets contents from being lost
  839.     which in result would force the user to select/type/pick the values
  840.     again, which may be unwanted feature for some kind of applications).
  841.  
  842.     It's safe to pass NULL as any of the argument.
  843.  
  844.  
  845.     INPUTS
  846.     app         - the application object the window should be added to
  847.     window      - the window object to add
  848.  
  849.     RESULT
  850.     FALSE if window couldn't be added, otherwise TRUE. See the BUGS!
  851.  
  852.     EXAMPLE
  853.  
  854.     Object *win = WindowObject,
  855.                     // our dynamically created window...,
  856.                     End;
  857.  
  858.  
  859.     if( mt_WinAttach( app, win ) )
  860.         {
  861.         if( mt_WinOpen( MyWindow ) )
  862.             {
  863.             //... ok, it worked ;-)
  864.             }
  865.         else
  866.             {
  867.             printf( "Can't open window!\n" );
  868.             }
  869.         }
  870.  
  871.     SEE ALSO
  872.     mt_WinDetach
  873.  
  874.     BUGS
  875.     Recently, return value indicates that the function arguments were
  876.     correct (both are not NULL), and NOT that the window is succesfuly
  877.     attached. Further versions will do that check anyway.
  878.  
  879. MuiToolkit/mt_WinDetach
  880.  
  881.     NAME
  882.     mt_WinDetach   - detach the given window object from the application
  883.  
  884.     SYNOPSIS
  885.     mt_WinDetach( app, window )
  886.                   A0   A1
  887.  
  888.  
  889.     void mt_WinDetach( Object *app, Object *window );
  890.  
  891.  
  892.     FUNCTION
  893.     This function removes the given window from the applicatin. It,
  894.     at least recently, does nothing else that OM_REMMEMBER, however
  895.     further releases will offer more features here. If you added
  896.     windows with mt_WinAttach, you should remove them with thah call
  897.  
  898.     It's safe to pass NULL as any of the argument.
  899.     
  900.  
  901.     INPUTS
  902.     app         - the application the window should be removed from
  903.     window      - the window object to remove
  904.  
  905.     RESULT
  906.     FALSE if window couldn't be added, otherwise TRUE. See the BUGS!
  907.  
  908.     EXAMPLE
  909.     mt_WinDetach( app, win ) );
  910.  
  911.     SEE ALSO
  912.  
  913.     BUGS
  914.  
  915. MuiToolkit/mt_Text
  916.  
  917.     NAME
  918.     mt_Text       - creates text object
  919.  
  920.     SYNOPSIS
  921.     mt_Text( text, preparse)
  922.              A0    A1
  923.  
  924.  
  925.     Object * mt_Text( char *text, char *preparse );
  926.  
  927.  
  928.     FUNCTION
  929.     Creates ordinary text object with
  930.  
  931.  
  932.     INPUTS
  933.     text      - contents of the text obejct
  934.     preparse  - MUI preparse formatter (e.g. "\033c" for centering)
  935.  
  936.     RESULT
  937.     Pointer to created object, or NULL if failed
  938.  
  939.  
  940.     EXAMPLE
  941.     mt_WinDetach( app, win ) );
  942.  
  943.     SEE ALSO
  944.  
  945.     BUGS
  946.  
  947. MuiToolkit/mt_GetStringA
  948.  
  949.     NAME
  950.     mt_GetString    - Full featured string requester
  951.  
  952.  
  953.     mt_GetStringA(app, buffer, buf_len, tags)
  954.                   A0   A1      D0       A2
  955.  
  956.     LONG mt_GetStringA ( Object *app, char *buffer, ULONG buf_len,
  957.                          struct TagItem *tags );
  958.  
  959.     LONG mt_GetString ( Object *app, char *buffer, ULONG buf_len, ... );
  960.  
  961.  
  962.     FUNCTION
  963.     Pops up a string requester. 
  964.  
  965.  
  966.  
  967.     INPUTS
  968.     app       - application object
  969.  
  970.     buffer    - pointer to the memory area (array etc), where the user
  971.                 entered string will be placed
  972.  
  973.     buf_len   - max lenght of the buffer
  974.  
  975.     tags      - optional tags. If you don't want to use any, put TAG_DONE
  976.                 See TAGS below
  977.  
  978.  
  979.     TAGS
  980.     mt_StrReq_WinTitle    - (STRPTR) custom requester window title
  981.  
  982.     mt_StrReq_Contents    - (STRPTR) default string gadget contents
  983.     
  984.     mt_StrReq_Ok          - (STRPTR) text you want to have as OK button
  985.  
  986.     mt_StrReq_Cancel      - (STRPTR) text you want to have as the CANCEL
  987.                             button
  988.  
  989.     mt_StrReq_Secret      - (BOOL) if TRUE, turns the requester into Secret
  990.                             mode. In that mode, only "*" are echoed instead
  991.                             of entered characters (good for passwords etc).
  992.                             Default: FALSE
  993.  
  994.     mt_StrReq_NoEmpty     - (BOOL) if TRUE, requester won't accept the empty
  995.                             string as the positive answers. User will have
  996.                             to click CANCEL to dismiss the requester, or
  997.                             type something. Good to force users to give e.g.
  998.                             new account name etc.
  999.  
  1000.     mt_StrReq_GroupTitle  - (STRPTR) the replacement string for "Enter string"
  1001.                             string gadget header
  1002.  
  1003.     mt_StrReq_Info        - (STRPTR) by using this tag, you can add extra info
  1004.                             text panel above the string gadget, with detailed
  1005.                             description or whatever you want. See the demo
  1006.                             
  1007.     mt_StrReq_StringHelp  - (STRPTR) optional bubble help text
  1008.  
  1009.  
  1010.     RESULT
  1011.     TRUE if user gave valid positive answer, otherwise FALSE
  1012.  
  1013.  
  1014.     EXAMPLE
  1015.     char buf[40];
  1016.     mt_GetString( app, buf, sizeof(buf),
  1017.                     mt_StrReq_Contents, "Hello",
  1018.                     TAG_DONE );
  1019.  
  1020.  
  1021.     SEE ALSO
  1022.     mt_demo.c
  1023.  
  1024.     BUGS
  1025.  
  1026. MuiToolkit/mt_GetIntegerA
  1027.  
  1028.     NAME
  1029.     mt_GetInteger    - Full featured integer requester
  1030.  
  1031.  
  1032.     mt_GetIntegerA(app, value, tags)
  1033.                    A0   A1     A2
  1034.  
  1035.     LONG mt_GetIntegerA ( Object *app, LONG *value, struct TagItem *tags );
  1036.  
  1037.     LONG mt_GetInteger ( Object *app, LONG *value, ... );
  1038.  
  1039.  
  1040.     FUNCTION
  1041.     Pop up a numeric requester. Recently it supports integers only, but
  1042.     both positive and negative values are properly handled.
  1043.  
  1044.  
  1045.     INPUTS
  1046.     app       - application object
  1047.     value     - pointer to the longword (32 bit) where the, where the user
  1048.                 entered value will be returned
  1049.     tags      - optional tags. If you don't want to use any, put TAG_DONE
  1050.                 See TAGS below
  1051.  
  1052.  
  1053.     TAGS
  1054.     mt_IntReq_WinTitle    - (STRPTR) custom requester window title
  1055.  
  1056.     mt_IntReq_Value       - (LONG) default string gadget contents
  1057.     
  1058.     mt_IntReq_Ok          - (STRPTR) text you want to have as OK button
  1059.  
  1060.     mt_IntReq_Cancel      - (STRPTR) text you want to have as the CANCEL
  1061.                             button
  1062.  
  1063.     mt_IntReq_Min         - (LONG) Optional, min value requester can accept
  1064.                             as correct answer
  1065.  
  1066.     mt_IntReq_Max         - (LONG) Optional, max value requester can accept
  1067.                             as correct answer
  1068.  
  1069.     mt_IntReq_GroupTitle  - (STRPTR) the replacement string for "Enter string"
  1070.                             string gadget header
  1071.  
  1072.     mt_IntReq_Info        - (STRPTR) by using this tag, you can add extra info
  1073.                             text panel above the string gadget, with detailed
  1074.                             description or whatever you want. See the demo
  1075.                             
  1076.     mt_IntReq_StringHelp  - (STRPTR) optional bubble help text
  1077.  
  1078.  
  1079.     RESULT
  1080.     TRUE if user gave valid positive answer, otherwise FALSE
  1081.  
  1082.  
  1083.     EXAMPLE
  1084.  
  1085.     LONG val;
  1086.     mt_GetInteger( app, &val,
  1087.                            mt_IntReq_Min, 30,
  1088.                            mt_IntReq_Max, 50,
  1089.                            TAG_DONE );
  1090.  
  1091.     SEE ALSO
  1092.     mt_demo.c
  1093.  
  1094.     BUGS
  1095.  
  1096. MuiToolkit/mt_Radio
  1097.  
  1098.     NAME
  1099.     mt_Radio          - creates radio button
  1100.  
  1101.     SYNOPSIS
  1102.     mt_Radio( array, label, help )
  1103.                A0    A1     A2
  1104.  
  1105.  
  1106.     Object * mt_Radio( char *array, char *label, char *help );
  1107.  
  1108.  
  1109.     FUNCTION
  1110.     Creates radio buttons.
  1111.  
  1112.  
  1113.     INPUTS
  1114.     array      - Here you can define what entries shall be
  1115.                  displayed in your radio gadget. You must
  1116.                  supply a pointer to a string array, containing
  1117.                  one entry for each item and terminated with a NULL.
  1118.  
  1119.                  Remember that radio gadget entries may contain any
  1120.                  text formatting code such as bold, italic or
  1121.                  underlined characters.
  1122.  
  1123.     label       - the label string, MT will try to extract the
  1124.                   hotkey from, or NULL if you either don't have
  1125.                   any, or don't want the button to be hotkeyed
  1126.  
  1127.     help        - optional pointer to the bubble help text,
  1128.                   or NULL if you don't have any
  1129.  
  1130.     RESULT
  1131.     Pointer to created object, or NULL if failed
  1132.  
  1133.     EXAMPLE
  1134.     char *radio[] = { "Apples",
  1135.                       "Bananas",
  1136.                       "Plums",
  1137.                       NULL };
  1138.     mt_Radio( radio, GetString( Label ), "ShortHelp" );
  1139.  
  1140.     SEE ALSO
  1141.     mt_demo.c
  1142.  
  1143.     BUGS
  1144.  
  1145. MuiToolkit/mt_Check
  1146.  
  1147.     NAME
  1148.     mt_Check          - expanded checkmark object
  1149.  
  1150.     SYNOPSIS
  1151.     mt_Check( label, alignment, state, help )
  1152.                A0    D0         D1     A1
  1153.  
  1154.  
  1155.     Object * mt_Check( char *label, ULONG alignment,
  1156.                         ULONG state, char *help);
  1157.  
  1158.  
  1159.     FUNCTION
  1160.     Creates expanded checkmark object. This function can can
  1161.     create ordinary checkmark, as well as complex one, with
  1162.     its label.
  1163.  
  1164.  
  1165.     INPUTS
  1166.     label      - the checkmark label string. If not NULL and
  1167.                  alignmet is not mt_Check_NoLabel, MT will
  1168.                  create a label, next to the checkmark object.
  1169.                  MT will as usual try to extract the hotkey from
  1170.                  this string as well
  1171.  
  1172.     alignment  - if label is not NULL, you can specify the way
  1173.                   MT should handle it. Available options are:
  1174.  
  1175.                   mt_Check_NoLabel    - don't create the label,
  1176.                                         just use the string as
  1177.                                         hotkey source
  1178.                   mt_Check_AlignRight - create label on the right
  1179.                                         side of the checkmark
  1180.                   mt_Check_AlignLeft  - create label on the left
  1181.                                         side of the checkmark
  1182.  
  1183.     state      - (BOOL) state of the checkmark
  1184.  
  1185.     help       - optional pointer to the bubble help text,
  1186.                  or NULL if you don't have any
  1187.  
  1188.     RESULT
  1189.     Pointer to created object, or NULL if failed
  1190.  
  1191.     EXAMPLE
  1192.     mt_Check( "_Check 1", mt_Check_AlignRight, FALSE, "ShortHelp" ),
  1193.  
  1194.     SEE ALSO
  1195.     mt_demo.c
  1196.  
  1197.     BUGS
  1198.  
  1199.